home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / AmigaTCP.lha / AmigaTCP / src / icmp.h < prev    next >
C/C++ Source or Header  |  1989-06-24  |  2KB  |  62 lines

  1. /* Internet Control Message Protocol */
  2.  
  3. /* Message types */
  4. #define    ECHO_REPLY    0    /* Echo Reply */
  5. #define    DEST_UNREACH    3    /* Destination Unreachable */
  6. #define    QUENCH        4    /* Source Quench */
  7. #define    REDIRECT    5    /* Redirect */
  8. #define    ECHO        8    /* Echo Request */
  9. #define    TIME_EXCEED    11    /* Time-to-live Exceeded */
  10. #define    PARAM_PROB    12    /* Parameter Problem */
  11. #define    TIMESTAMP    13    /* Timestamp */
  12. #define    TIME_REPLY    14    /* Timestamp Reply */
  13. #define    INFO_RQST    15    /* Information Request */
  14. #define    INFO_REPLY    16    /* Information Reply */
  15.  
  16. struct icmp {
  17.     char type;
  18.     char code;
  19.     int16 checksum;
  20.     union icmp_args {
  21.         int32 unused;
  22.         char pointer;
  23.         int32 address;
  24.         struct {
  25.             int16 id;
  26.             int16 seq;
  27.         } echo;
  28.     } args;
  29. };
  30. #define    NULLICMP    ((union icmp_args *)NULL)
  31.     
  32. /* Destination Unreachable codes */
  33. #define    NET_UNREACH    0    /* Net unreachable */
  34. #define    HOST_UNREACH    1    /* Host unreachable */
  35. #define    PROT_UNREACH    2    /* Protocol unreachable */
  36. #define    PORT_UNREACH    3    /* Port unreachable */
  37. #define    FRAG_NEEDED    4    /* Fragmentation needed and DF set */
  38. #define    ROUTE_FAIL    5    /* Source route failed */
  39.  
  40. /* Time Exceeded codes */
  41. #define    TTL_EXCEED    0    /* Time-to-live exceeded */
  42. #define    FRAG_EXCEED    1    /* Fragment reassembly time exceeded */
  43.  
  44. /* Redirect message codes */
  45. #define    REDR_NET    0    /* Redirect for the network */
  46. #define    REDR_HOST    1    /* Redirect for the host */
  47. #define    REDR_TOS    2    /* Redirect for Type of Service, or-ed with prev */
  48.  
  49. struct icmp_errors {
  50.     unsigned checksum;        /* ICMP Checksum errors */
  51.     unsigned nospace;        /* alloc_mbuf failed someplace */
  52.     unsigned noloop;        /* No ICMP in response to an ICMP */
  53.     unsigned bdcsts;        /* Ignore broadcast ICMPs */
  54. };
  55. #define    ICMP_TYPES    17
  56. struct icmp_stats {
  57.     unsigned input[ICMP_TYPES];    /* ICMP input stats by type */
  58.     unsigned output[ICMP_TYPES];    /* ICMP output stats by type */
  59. };
  60.  
  61. void icmp_dump();
  62.